package com.neelsys.visualisation.service.adapter;

import com.neelsys.visualisation.domain.MajorCombination;

public class NextLevelsAdapter {

	private long level;

	private MajorCombAdapter combAdapter;

	public NextLevelsAdapter(MajorCombAdapter combAdapter, long level) {
		this.combAdapter = combAdapter;
		this.level = level;
	}

	public void adapt(MajorCombination majorComb) {

		NextLevelEntranceTestAdapter entranceAdapter = new NextLevelEntranceTestAdapter(
				combAdapter, level + 1);
		combAdapter.template.fetch(majorComb.getEntranceTests());
		entranceAdapter.adapt(majorComb.getEntranceTests(), majorComb);

		NextLevelCourseAdapter nextLvlCourse = new NextLevelCourseAdapter(
				combAdapter, level + 2);
		combAdapter.template.fetch(majorComb.getNextCourses());
		nextLvlCourse.adapt(majorComb.getNextCourses(), majorComb);

		NextLevelJobsAdapter nextLvlJobs = new NextLevelJobsAdapter(
				combAdapter, level + 1);
		combAdapter.template.fetch(majorComb.getPossibleJobs());
		nextLvlJobs.adapt(majorComb.getPossibleJobs(), majorComb);
	}
}
